import http from "@/utils/http";
export interface  productitem{
    _id?: string;
    name?: string;
    image?: string;
    type?: string;
    price?: string;
    sales?: string;
    stock?: string;
    sort?: number;
    state?: number;
    hasChildren?: boolean;
    classifies?:string[]
}

let products={
//查询商品数据
search:(data?:pagequery)=>http.post('/products/search',data),
//新增商品数据
add:(data: productitem)=>http.post('/products/add',data),
//删除商品数据
remove:(data:deleteparams)=>http.delete('/products/remove',data),
//修改商品
update:(data:productitem)=>http.put('/products/update',data),

// //获取详情
// getDetail:(data:{_id:string})=>http.get('/products/getDetailById',data)

getDetail:(data:{_id:string})=>http.get('/products/getDetailById',data)
}

export default products;
